/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-primary: #58a6ff;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;
    --accent-purple: #a371f7;
    
    --border-color: #30363d;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    
    --transition: all 0.2s ease;
    
    --sidebar-width: 240px;
    --header-height: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== App Container ===== */
.app-container {
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
}

/* ===== Auth Page ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(88, 166, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(163, 113, 247, 0.1) 0%, transparent 50%),
        var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 36px;
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.5));
}

.logo h1 {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--border-radius);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.label-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label-with-action label {
    margin-bottom: 0;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), #4193ef);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
    display: none;
}

.message.error {
    display: block;
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--accent-danger);
}

.message.success {
    display: block;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: var(--accent-success);
}

/* ===== Main Page Layout ===== */
#main-page {
    display: none;
}

#main-page.active {
    display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo-icon {
    font-size: 24px;
}

.sidebar-header .logo-text {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.user-avatar {
    font-size: 20px;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(248, 81, 73, 0.15);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    background: var(--bg-primary);
    min-height: 100vh;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.view-header .btn-primary {
    width: auto;
    padding: 10px 20px;
}

.view-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tasks-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-filter-group {
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.status-filter-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-btn.checked {
    background: rgba(88, 166, 255, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.filter-btn input[type="checkbox"] {
    display: none;
}

/* Search Input */
.search-input {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    width: 140px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Load More Indicator */
.load-more-indicator {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filter checkbox style */
.filter-btn input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--accent-primary);
}

/* ===== Data Table ===== */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.tasks-table {
    table-layout: fixed;
}

.tasks-table .task-col-id {
    width: 80px;
}

.tasks-table .task-col-title {
    width: 34%;
}

.tasks-table .task-col-status {
    width: 130px;
}

.tasks-table .task-col-client {
    width: 18%;
}

.tasks-table .task-col-created {
    width: 168px;
}

.tasks-table .task-col-actions {
    width: 190px;
}

.task-title-cell {
    max-width: 0;
}

.task-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.task-actions-cell {
    white-space: normal;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-actions .btn-action {
    margin-right: 0;
}

.clients-table {
    min-width: 1240px;
    table-layout: fixed;
}

.clients-table .client-col-id {
    width: 78px;
}

.clients-table .client-col-name {
    width: 22%;
}

.clients-table .client-col-cloud {
    width: 110px;
}

.clients-table .client-col-agent {
    width: 160px;
}

.clients-table .client-col-version {
    width: 90px;
}

.clients-table .client-col-creator {
    width: 140px;
}

.clients-table .client-col-heartbeat {
    width: 160px;
}

.clients-table .client-col-created {
    width: 170px;
}

.clients-table .client-col-actions {
    width: 200px;
}

.client-name-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.client-name-text,
.client-creator {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deployment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.deployment-badge.cloud {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.deployment-badge.local {
    background: rgba(163, 113, 247, 0.15);
    color: var(--accent-purple);
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-heartbeat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.client-heartbeat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.client-heartbeat-dot.online {
    background: var(--accent-success);
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.12);
}

.client-heartbeat-dot.offline {
    background: var(--text-muted);
    box-shadow: 0 0 0 4px rgba(110, 118, 129, 0.12);
}

.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-actions .btn-action {
    margin-right: 0;
}

.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.task-page-size {
    min-width: 76px;
    padding: 6px 28px 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.task-page-size:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.task-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.task-pagination-summary,
.task-page-info {
    color: var(--text-secondary);
    font-size: 13px;
}

.task-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-pagination .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
}

.status-running {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
    font-weight: 500;
}

.status-suspended {
    background-color: #f39c12;
    color: white;
}

.status-completed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

/* Action Buttons */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
    margin-right: 8px;
}

.btn-edit {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.btn-edit:hover {
    background: rgba(88, 166, 255, 0.25);
}

.btn-delete {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

.btn-delete:hover {
    background: rgba(248, 81, 73, 0.25);
}

.btn-reset {
    background: rgba(255, 180, 50, 0.15);
    color: #ffb432;
}

.btn-reset:hover {
    background: rgba(255, 180, 50, 0.25);
}

.btn-info {
    background: rgba(163, 113, 247, 0.15);
    color: var(--accent-purple);
}

.btn-info:hover {
    background: rgba(163, 113, 247, 0.25);
}

.btn-copy {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

.btn-copy:hover {
    background: rgba(210, 153, 34, 0.25);
}

.btn-chat {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.btn-chat:hover {
    background: rgba(63, 185, 80, 0.25);
}

/* Task Detail Modal Styles */
.task-detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-detail-section h4 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.task-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-link-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 13px;
    transition: var(--transition);
}

.task-link-item:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent-primary);
}

.task-desc-text {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.links-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.links-editor .types-table {
    margin-bottom: 0;
}

.links-editor .types-table input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.links-editor .types-table input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

/* 只读字段样式 */
.readonly-field {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 表单行 - 并排布局 */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group-half {
    flex: 2;
    min-width: 0;
}

.form-group-quarter {
    flex: 1;
    min-width: 0;
}

/* Task Edit Modal - larger size */
.modal.modal-task-edit,
.modal.modal-task-detail {
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.modal-task-edit .modal-content,
.modal.modal-task-detail .modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.modal-task-edit .task-edit-content,
.modal.modal-task-detail .task-detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 滚动区域 */
.task-edit-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
    min-height: 0;
}

/* 描述框所在的 form-group 不设置 flex */
.task-edit-scroll .form-group {
    flex-shrink: 0;
}

/* 自定义滚动条样式 */
.task-edit-scroll::-webkit-scrollbar {
    width: 6px;
}

.task-edit-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.task-edit-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.task-edit-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 任务描述 - 自适应高度 */
.modal.modal-task-edit #task-edit-desc,
.modal.modal-task-detail #task-detail-desc {
    min-height: 120px;
    height: 150px;
    max-height: 800px;
    resize: vertical;
}

/* 任务描述文本 - 查看模式 */
.task-desc-text {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal.modal-task-edit .modal-actions,
.modal.modal-task-detail .modal-actions {
    flex-shrink: 0;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal.modal-task-edit .modal-actions .btn-primary,
.modal.modal-task-edit .modal-actions .btn-secondary,
.modal.modal-task-detail .modal-actions .btn-primary,
.modal.modal-task-detail .modal-actions .btn-secondary {
    width: auto;
    min-width: 80px;
    padding: 8px 24px;
    flex: none;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state.show {
    display: flex;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content {
    padding: 24px;
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content .btn-primary {
    margin-top: 8px;
}

/* Status Select */
.status-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.status-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Status Select with status colors */
.status-select.status-running {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
    border-color: rgba(79, 70, 229, 0.4);
    font-weight: 500;
}

.status-select.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.status-select.status-suspended {
    background-color: #f39c12;
    color: white;
    border-color: rgba(243, 156, 18, 0.5);
}

.status-select.status-completed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.25);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success {
    border-color: var(--accent-success);
}

.toast.success::before {
    content: '✓';
    color: var(--accent-success);
    font-weight: bold;
}

.toast.error {
    border-color: var(--accent-danger);
}

.toast.error::before {
    content: '✕';
    color: var(--accent-danger);
    font-weight: bold;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .auth-card {
        padding: 24px;
    }

    .view-header {
        align-items: flex-start;
    }

    .view-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .config-tabs-nav {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .config-section {
        padding: 18px;
    }

    .config-section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .config-add-btn {
        align-self: flex-start;
    }

    .client-basic-grid {
        grid-template-columns: 1fr;
    }

    .env-var-row {
        flex-direction: column;
        align-items: stretch;
    }

    .env-var-key-input,
    .env-var-val-input {
        width: 100%;
        min-width: 0;
    }

    .env-var-eq {
        display: none;
    }

    .env-var-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .repo-card-header,
    .repo-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .repo-field-row .repo-field.repo-field-short,
    .repo-field-row.repo-field-row-3 .repo-field.repo-field-url {
        flex: 1 1 auto;
        min-width: 0;
    }

    .clients-table {
        min-width: 0;
    }

    .clients-table thead {
        display: none;
    }

    .clients-table,
    .clients-table tbody,
    .clients-table tr,
    .clients-table td {
        display: block;
        width: 100%;
    }

    .clients-table tbody {
        padding: 14px;
    }

    .clients-table tbody tr {
        margin-bottom: 14px;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(88, 166, 255, 0.04), rgba(13, 17, 23, 0));
        box-shadow: var(--shadow-sm);
    }

    .clients-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .clients-table tbody tr:hover {
        background: linear-gradient(180deg, rgba(88, 166, 255, 0.08), rgba(13, 17, 23, 0));
    }

    .clients-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

    .clients-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .clients-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        text-align: left;
    }

    .clients-table td[data-label="名称"],
    .clients-table td[data-label="操作"] {
        align-items: flex-start;
        text-align: left;
    }

    .clients-table td[data-label="名称"] {
        flex-direction: column;
        gap: 8px;
    }

    .clients-table td[data-label="名称"]::before {
        width: 100%;
    }

    .clients-table td[data-label="操作"] {
        flex-direction: column;
        gap: 12px;
    }

    .clients-table td[data-label="操作"]::before {
        width: 100%;
    }

    .clients-table .client-actions {
        width: 100%;
    }

    .clients-table .client-actions .btn-action {
        flex: 1 1 calc(33.333% - 6px);
        text-align: center;
    }

    .task-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-pagination {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== Task Key Style ===== */
.task-key {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
}

/* ===== Type Tag ===== */
.type-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(163, 113, 247, 0.15);
    color: var(--accent-purple);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== Time Display ===== */
.time-display {
    color: var(--text-secondary);
    font-size: 13px;
}

.time-display.online {
    color: var(--accent-success);
}

.time-display.offline {
    color: var(--text-muted);
}

/* ===== Types Editor ===== */
.types-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.types-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.types-input-row input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.types-input-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.types-table {
    width: 100%;
    border-collapse: collapse;
}

.types-table th,
.types-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.types-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.types-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.types-table tbody tr:last-child td {
    border-bottom: none;
}

.types-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-small.btn-add {
    background: var(--accent-primary);
    color: white;
}

.btn-small.btn-add:hover {
    background: #4a90e0;
}

.btn-small.btn-delete {
    background: transparent;
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
    white-space: nowrap;
}

.btn-small.btn-delete:hover {
    background: var(--accent-danger);
    color: white;
}

/* ===== Flow Chart ===== */
.flow-chart-container {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: auto;
    position: relative;
}

.flow-chart-canvas {
    position: relative;
    min-width: 100%;
    min-height: 100%;
    padding: 20px;
    padding-bottom: 100px;
}

.flow-chart-edges {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.flow-edge {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-linecap: round;
}

.flow-chart-nodes {
    position: relative;
    z-index: 2;
}

/* Flow Node */
.flow-node {
    position: absolute;
    width: 280px;
    min-height: 120px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.flow-node:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.flow-node-selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Node Status Colors */
.flow-node-pending {
    border-left: 4px solid var(--accent-warning);
}

.flow-node-in_progress {
    border-left: 4px solid var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(88, 166, 255, 0.05) 100%);
}

.flow-node-completed {
    border-left: 4px solid var(--accent-success);
    opacity: 0.85;
}

.flow-node-skipped {
    border-left: 4px solid var(--text-muted);
    opacity: 0.6;
}

.flow-node-failed {
    border-left: 4px solid var(--accent-danger);
}

/* Node Header */
.flow-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.flow-node-status-icon {
    font-size: 16px;
}

.flow-node-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.flow-node-status-text {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.flow-node-in_progress .flow-node-status-text {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.flow-node-completed .flow-node-status-text {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

/* Node Body */
.flow-node-body {
    padding: 12px 16px;
}

.flow-node-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 8px 0;
}

/* Node Actions */
.flow-node-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.flow-btn-complete {
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-success), #2ea043);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.flow-btn-complete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 185, 80, 0.4);
}

/* Flow Toolbar */
.flow-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.flow-toolbar .btn-secondary {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-toolbar .btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.flow-toolbar .btn-secondary.btn-success {
    background: rgba(63, 185, 80, 0.15);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.flow-toolbar .btn-secondary.btn-success:hover {
    background: var(--accent-success);
    color: white;
}

/* Flow Info Panel */
.flow-info-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.flow-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flow-progress-bar {
    width: 200px;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.flow-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.flow-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Modal size for flow detail */
/* Flow detail modal - extra large */
.modal.modal-flow {
    max-width: 1200px;
    height: 80vh;
}

.modal.modal-flow .modal-content {
    padding: 0;
    height: calc(80vh - 60px);
    overflow: hidden;
}

/* Required field indicator */
.required {
    color: var(--accent-danger);
}

/* Text muted style */
.text-muted {
    color: var(--text-muted);
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* ===== Node Detail Panel ===== */
.node-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.node-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 1px solid var(--border-color);
}

.node-panel-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.node-panel-info {
    flex: 1;
    min-width: 0;
}

.node-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-panel-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
}

.node-panel-section {
    padding: 12px 16px;
}

.node-panel-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-panel-label.section-title {
    font-size: 13px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.node-panel-value {
    font-size: 14px;
    color: var(--text-primary);
}

.node-panel-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.node-panel-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.node-panel-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.node-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.node-panel-empty .empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.node-panel-empty p {
    font-size: 14px;
}

.node-panel-empty-fields {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Node field styles */
.node-field {
    margin-bottom: 16px;
}

.node-field:last-child {
    margin-bottom: 0;
}

.node-field-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.node-field-required .node-field-label::after {
    content: ' *';
    color: var(--accent-danger);
}

.node-field-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    padding: 8px 0;
}

.node-field-input,
.node-field-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.node-field-input:focus,
.node-field-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.node-field-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
}

.node-field-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* Node Table Field Styles */
.node-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.node-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.node-table-thead {
    background: var(--bg-secondary);
}

.node-table-th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.node-table-tbody .node-table-tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.node-table-tbody .node-table-tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.node-table-td {
    padding: 8px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.node-table-tbody .node-table-tr:last-child .node-table-td {
    border-bottom: none;
}

/* Table input for editable mode */
.node-table-input {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.node-table-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.node-table-input:hover {
    border-color: var(--text-muted);
}

/* Status badge in panel */
.node-panel .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
}

.status-badge.status-running,
.status-badge.status-in_progress {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
    font-weight: 500;
}

.status-badge.status-reviewing {
    background: rgba(163, 113, 247, 0.15);
    color: var(--accent-purple);
}

.status-badge.status-reviewed,
.status-badge.status-done,
.status-badge.status-completed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.status-badge.status-error {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

.status-badge.status-revising {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

/* Updated flow node styles for compact display */
.flow-node {
    position: absolute;
    width: 220px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
}

.flow-node:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.flow-node-selected {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25) !important;
}

.flow-node-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

.flow-node-status-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.flow-node-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-node-status-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Node status colors */
.flow-node-pending {
    border-left: 4px solid var(--accent-warning);
}

.flow-node-pending .flow-node-status-badge {
    background: rgba(210, 153, 34, 0.1);
    color: var(--accent-warning);
}

.flow-node-running,
.flow-node-in_progress {
    border-left: 4px solid var(--accent-primary);
}

.flow-node-running .flow-node-status-badge,
.flow-node-in_progress .flow-node-status-badge {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-primary);
}

.flow-node-reviewing {
    border-left: 4px solid var(--accent-purple);
}

.flow-node-reviewing .flow-node-status-badge {
    background: rgba(163, 113, 247, 0.1);
    color: var(--accent-purple);
}

.flow-node-revising {
    border-left: 4px solid var(--accent-warning);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(210, 153, 34, 0.05) 100%);
}

.flow-node-revising .flow-node-status-badge {
    background: rgba(210, 153, 34, 0.1);
    color: var(--accent-warning);
}

.flow-node-reviewed,
.flow-node-done,
.flow-node-completed {
    border-left: 4px solid var(--accent-success);
}

.flow-node-reviewed .flow-node-status-badge,
.flow-node-done .flow-node-status-badge,
.flow-node-completed .flow-node-status-badge {
    background: rgba(63, 185, 80, 0.1);
    color: var(--accent-success);
}

.flow-node-failed {
    border-left: 4px solid var(--accent-danger);
}

.flow-node-failed .flow-node-status-badge {
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-danger);
}

.flow-node-error {
    border-left: 4px solid var(--accent-danger);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(248, 81, 73, 0.05) 100%);
}

.flow-node-error .flow-node-status-badge {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

/* ===== HTML/富文本字段样式 ===== */
.node-field-html {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    word-break: break-word;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.node-field-html a {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: var(--transition);
}

.node-field-html a:hover {
    color: var(--accent-purple);
    text-decoration: none;
}

.node-field-html p {
    margin: 0 0 8px 0;
}

.node-field-html p:last-child {
    margin-bottom: 0;
}

.node-field-html ul,
.node-field-html ol {
    margin: 8px 0;
    padding-left: 20px;
}

.node-field-html li {
    margin-bottom: 4px;
}

.node-field-html code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.node-field-html pre {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    margin: 8px 0;
}

.node-field-html strong,
.node-field-html b {
    font-weight: 600;
    color: var(--text-primary);
}

.node-field-html em,
.node-field-html i {
    font-style: italic;
}

/* ===== 超链接字段样式 ===== */
.node-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.node-link-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}


/* ===== OKR Styles - Waterfall Version ===== */

/* 周期导航 */
.okr-cycle-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.cycle-type-btns {
    display: flex;
    gap: 8px;
}

.cycle-type-btn {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.cycle-type-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.cycle-type-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.cycle-period-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cycle-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.cycle-nav-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.cycle-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cycle-period-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.cycle-period-select {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
}

.cycle-period-select:hover {
    border-color: var(--accent-primary);
}

.cycle-period-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* 瀑布流容器 */
.okr-waterfall-container {
    max-width: 900px;
}

.okr-waterfall {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 目标块 */
.okr-objective-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
}

/* O行 */
.okr-o-row {
    display: flex;
    align-items: stretch;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.okr-reorder-side {
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    gap: 2px;
}

.okr-reorder-btn {
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-reorder-btn,
.okr-kr-row:hover .okr-reorder-btn {
    opacity: 1;
}

.okr-reorder-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.okr-reorder-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.okr-add-side {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.okr-side-add-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-side-add-btn,
.okr-kr-row:hover .okr-side-add-btn {
    opacity: 1;
}

.okr-side-add-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.okr-o-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.okr-o-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 30px;
}

.okr-inline-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.okr-inline-input:hover {
    background: var(--bg-secondary);
}

.okr-inline-input:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.okr-o-title {
    font-weight: 600;
    font-size: 16px;
}

.okr-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-delete-btn,
.okr-kr-row:hover .okr-delete-btn {
    opacity: 1;
}

.okr-delete-btn:hover {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

/* KR行 */
.okr-kr-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
}

.okr-kr-row:last-child {
    border-bottom: none;
}

.okr-kr-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    padding-left: 24px;
}

.okr-kr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-purple);
    min-width: 36px;
}

.okr-kr-title {
    font-size: 14px;
}

/* 添加按钮行 */
.okr-add-row {
    padding: 8px 16px;
    padding-left: 56px;
}

.okr-add-kr-row {
    background: var(--bg-card);
}

.okr-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.okr-add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(88, 166, 255, 0.05);
}

.okr-add-btn .add-icon {
    font-size: 16px;
    font-weight: 600;
}

.okr-add-objective {
    margin-top: 8px;
}

/* 保存指示器 */
.okr-save-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: var(--accent-success);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.okr-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* 保留旧的卡片样式（供兼容） */
.okr-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.okr-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.okr-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(88, 166, 255, 0.1);
}

.okr-card-header {
    margin-bottom: 16px;
}

.okr-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.okr-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.okr-status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.okr-status-badge.status-draft {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.okr-status-badge.status-active {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
}

.okr-status-badge.status-completed {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.okr-status-badge.status-archived {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.okr-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.okr-progress-bar {
    position: relative;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: visible;
}

.okr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.okr-progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.okr-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.okr-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.okr-kr-count {
    color: var(--text-secondary);
    font-size: 13px;
}

.okr-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm.btn-primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-sm.btn-primary:hover {
    background: #4193ef;
}

.btn-sm.btn-danger {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border-color: transparent;
}

.btn-sm.btn-danger:hover {
    background: rgba(248, 81, 73, 0.25);
}

/* OKR Detail Modal */
.objective-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.obj-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.obj-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.obj-progress input[type="range"] {
    width: 150px;
}

.obj-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.kr-section {
    margin-top: 16px;
}

.kr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kr-section-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

.kr-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kr-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
}

.kr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kr-title {
    font-weight: 500;
    color: var(--text-primary);
}

.kr-actions {
    display: flex;
    gap: 6px;
}

.kr-progress-bar {
    position: relative;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    margin-bottom: 8px;
}

.kr-progress-fill {
    height: 100%;
    background: var(--accent-success);
    border-radius: 3px;
}

.kr-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    color: var(--text-secondary);
}

.kr-value {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.kr-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.kr-tasks {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.kr-tasks-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 8px;
}

.task-tag {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent-primary);
    margin-right: 6px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Form Select */
.form-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ===== TodoList Styles ===== */
.todo-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
}

.todo-add-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.todo-add-row input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.todo-add-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.btn-add-todo {
    width: auto;
    padding: 12px 24px;
    flex-shrink: 0;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.todo-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-content {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-success);
    cursor: pointer;
    flex-shrink: 0;
}

.todo-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    cursor: text;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.todo-content:hover {
    background: var(--bg-secondary);
}

.todo-content-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.todo-delete {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--accent-danger);
    border-radius: 4px;
    color: var(--accent-danger);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0;
}

.todo-item:hover .todo-delete {
    opacity: 1;
}

.todo-delete:hover {
    background: var(--accent-danger);
    color: white;
}

/* Todo filter buttons */
.todo-filter-btns {
    display: flex;
    gap: 8px;
}

.todo-filter-btns .filter-btn input[type="radio"] {
    display: none;
}

/* ===== 仓库配置瀑布流样式 ===== */
.repos-waterfall {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.repos-empty-tip {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.repo-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.repo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.repo-card-index {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-primary);
}

.repo-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.repo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.repo-field label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.repo-field input,
.repo-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.repo-field input:focus,
.repo-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.repo-field textarea {
    resize: vertical;
    min-height: 60px;
}

.repo-field-row {
    display: flex;
    gap: 12px;
}

.repo-field-row .repo-field {
    flex: 1;
}

.repo-field-row .repo-field.repo-field-short {
    flex: 0 0 140px;
}

.repo-field-row.repo-field-row-3 .repo-field.repo-field-url {
    flex: 1;
    min-width: 200px;
}

/* 文档仓库标记样式 */
.repo-card-docs {
    border-color: var(--accent-success);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(63, 185, 80, 0.05) 100%);
}

.repo-card-docs .repo-card-header {
    background: rgba(63, 185, 80, 0.1);
}

.repo-docs-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
    margin-right: 12px;
}

.repo-docs-toggle input[type="radio"] {
    accent-color: var(--accent-success);
    cursor: pointer;
}

.repo-docs-label {
    color: var(--text-secondary);
    transition: var(--transition);
}

.repo-docs-toggle input[type="radio"]:checked + .repo-docs-label {
    color: var(--accent-success);
    font-weight: 600;
}

/* ===== 执行状态错误样式 ===== */
.flow-status-error {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-danger);
}

.btn-error-detail {
    padding: 2px 8px;
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid var(--accent-danger);
    border-radius: 4px;
    color: var(--accent-danger);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-error-detail:hover {
    background: var(--accent-danger);
    color: white;
}

/* 错误详情弹窗样式 */
.error-detail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.error-detail-icon {
    font-size: 48px;
}

.error-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-danger);
}

.error-detail-message {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.error-pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

/* ===== 执行详情弹窗样式 ===== */
.modal-flow .modal {
    max-width: 800px;
    max-height: 90vh;
}

.flow-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flow-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
}

.flow-modal-empty .empty-icon {
    font-size: 48px;
}

.flow-modal-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 13px;
}

.flow-modal-label {
    color: var(--text-muted);
}

.flow-modal-node-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
}

.node-status-icon {
    font-size: 20px;
}

.node-status-badge {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.node-status-badge.status-pending {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.node-status-badge.status-running,
.node-status-badge.status-in_progress {
    background: rgba(163, 113, 247, 0.15);
    color: #a371f7;
}

.node-status-badge.status-done,
.node-status-badge.status-completed,
.node-status-badge.status-reviewed {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

.node-status-badge.status-reviewing,
.node-status-badge.status-revising {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

.node-status-badge.status-error,
.node-status-badge.status-failed {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

.flow-modal-node-detail {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.flow-modal-node-detail .node-field {
    margin-bottom: 16px;
}

.flow-modal-node-detail .node-field:last-child {
    margin-bottom: 0;
}

.flow-modal-node-detail .node-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.flow-modal-node-detail .node-field-html {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.flow-modal-node-detail .node-field-html a {
    color: var(--accent-primary);
    text-decoration: none;
}

.flow-modal-node-detail .node-field-html a:hover {
    text-decoration: underline;
}

.node-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.node-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.node-link-btn:hover {
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
}

.node-panel-empty-fields {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 客户端配置页面 ===== */

.view-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-back:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Tab 导航 */
.config-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 0 0;
    margin-bottom: 24px;
}

.config-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: -1px;
}
.config-tab-btn:hover:not(:disabled) {
    color: var(--text-primary);
}
.config-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.config-tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tab 内容面板 */
.config-tab-panels {
    flex: 1;
    overflow-y: auto;
}
.config-tab-panel {
    display: none;
}
.config-tab-panel.active {
    display: block;
}

/* Section */
.config-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.config-section-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.config-section-intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.config-section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}
.config-add-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.config-section-tip {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
}
.tip-info {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(88, 166, 255, 0.3);
}
.tip-warn {
    background: rgba(210, 153, 34, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.client-basic-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) minmax(180px, 1fr);
    gap: 16px;
    align-items: end;
}

.client-basic-grid .form-group {
    margin-bottom: 0;
}

.client-basic-grid input,
.client-basic-grid select {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* 环境变量列表 */
.env-vars-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.env-var-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
}
.env-var-row-editing {
    border-color: var(--accent-primary);
}
.env-var-key {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 120px;
    word-break: break-all;
}
.env-var-eq {
    color: var(--text-muted);
    flex-shrink: 0;
}
.env-var-val {
    color: var(--text-secondary);
    flex: 1;
    word-break: break-all;
}
.env-var-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}
.env-var-key-input {
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 140px;
    width: 240px;
}
.env-var-key-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}
.env-var-val-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    flex: 1;
}
.env-var-val-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}
.env-var-key-input:disabled,
.env-var-val-input:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}
.btn-save-sm {
    padding: 4px 10px;
    background: var(--accent-success);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: var(--transition);
}
.btn-save-sm:hover {
    opacity: 0.85;
}
.btn-cancel-sm {
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: var(--transition);
}
.btn-cancel-sm:hover {
    background: var(--bg-tertiary);
}